home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: 19 Mar 1999
- // Author: jcs
- //
- // Description:
- // This script is a panel wrapper around the componentEditor script. It
- // handles creating the panel, unparented listers, saving of state,
- // initializing of preferences, etc.
- //
- //////////////////////////////////////////////////////////////////////
- //
- // Procedure Name:
- // createComponentEditorPanel
- //
- // Description:
- // Called once on panel creation. Leave initialization for
- // the init callback. Do nothing here.
- //
- // Input Arguments:
- // $whichPanel - name of the panel, but not used.
- //
- // Return Value:
- // None.
- //
-
- if ( !`exists buildComponentEditorControls` ) {
- source componentEditorWindow;
- }
-
- global proc buildComponentEditorContextHelpItems(
- string $nameRoot, string $menuParent)
- //
- // Description:
- // Build context sensitive menu items
- //
- // Input Arguments:
- // $nameRoot - name to use as the root of all item names
- // $menuParent - the name of the parent of this menu
- //
- // Return Value:
- // None
- //
- {
- menuItem -label "Help on Component Editor..."
- -enableCommandRepeat false
- -command "showHelp ComponentEditor";
- }
-
- global proc createComponentEditorPanel(string $whichPanel)
- {
- // Add support for the Context Sensitive Help Menu.
- //
- addContextHelpProc $whichPanel "buildComponentEditorContextHelpItems";
- }
-
- //////////////////////////////////////////////////////////////////////
- //
- // Procedure Name:
- // initComponentEditorPanel
- //
- // Description:
- // Initialize editors to starting state.
- //
- // Input Arguments:
- // $whichPanel - name of the panel, but not used.
- //
- // Return Value:
- // None.
- //
-
- global proc initComponentEditorPanel(string $whichPanel)
- {}
-
- //////////////////////////////////////////////////////////////////////
- //
- // Procedure Name:
- // addComponentEditorPanel
- //
- // Description:
- // create unparented editors requested by the prefs
- //
- // Input Arguments:
- // $whichPanel - name of the panel, but not used.
- //
- // Return Value:
- // None.
- //
- global proc addComponentEditorPanel(string $whichPanel)
- {
- // the scripted panel control is a menuBarLayout; it contains a
- // frame-layout child with the same name as the panel.
- //
- // Therefore: $panelControl is a menuBarLayout
- // $panelControl+"|"+$whichPanel is a frame layout
-
- buildComponentEditorControls ;
- }
-
- //////////////////////////////////////////////////////////////////////
- //
- // Procedure Name:
- // removeComponentEditorPanel
- //
- // Description:
- // do whatever is necessary to clean up a given panel
- //
- // Input Arguments:
- // $whichPanel - name of the panel to clean up.
- //
- // Return Value:
- // None.
- //
- global proc removeComponentEditorPanel(string $whichPanel)
- {}
-
- //////////////////////////////////////////////////////////////////////
- //
- // Procedure Name:
- // saveComponentEditorPanel
- //
- // Description:
- // examine a given componentEditorPanel and return a MEL command
- // which will recreate the panel in its current state.
- //
- // Input Arguments:
- // $whichPanel - name of the panel to have its state examined.
- //
- // Return Value:
- // a command string that will create a componentEditor panel in the
- // same state as the input $whichPanel.
- //
- global proc string saveComponentEditorPanel(string $whichPanel)
- {
- string $reCreateCmd = "";
-
- return $reCreateCmd;
- }
-
- global proc string componentEditorPanel(string $panelName) {
- //
- // Procedure Name:
- // componentEditorPanel
- //
- // Description:
- // This proc defines the componentEditor panel type and
- // instantiates one. Only one componentEditorPanel is allowed.
- //
- // Input Arguments:
- // $panelName the name of the panel to be created.
- //
- // Return Value:
- // None.
- //
- global string $gMainPane;
-
- if (!`scriptedPanelType -exists componentEditorPanel`) {
-
- // define the type of panel
- //
- scriptedPanelType
- -createCallback "createComponentEditorPanel"
- -initCallback "initComponentEditorPanel"
- -addCallback "addComponentEditorPanel"
- -removeCallback "removeComponentEditorPanel"
- -saveStateCallback "saveComponentEditorPanel"
- componentEditorPanel;
-
- // create an instance of the test panel
- //
- setParent $gMainPane;
- scriptedPanel -unParent -type "componentEditorPanel" $panelName;
- }
-
- return $panelName;
- }
-